package com.company.sendemo.basics.zzInterview.write;

import java.util.ArrayList;
import java.util.List;

public class DemoEleven {
    public static void generate(int n) {
        int slice_index = 1;
        int count = 1;
        while (count <= n) {
            List<Integer> target = rangs(slice_index, slice_index + 5);
            if (target.get(2) < count && slice_index + 5 <= n) {
                slice_index += 1;
                continue;
            }
            StringBuilder sb = new StringBuilder();
            for (Integer i : target) {
                if (i == count) {
                    sb.append(String.format("'&d&s',", i, "*"));
                } else {
                    sb.append(String.format("'&d&s',", i, ""));
                }
            }
            System.out.println(String.format("%d: [%s 森！！仔]", count, sb.substring(0,sb.length() - 1)));
            count += 1;
        }
    }
    public static List<Integer> rangs(int start, int end) {
        System.out.println(start+"   "+end);
        List<Integer> l = new ArrayList<Integer>();
        for (int i = start; i < end;  i++) {
            l.add(i);
        }
        System.out.println(l + "l等于"   +start +"  " + end);
        return l;
    }
    public static void main(String[] args){
        generate(6);
    }
}
